home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_gd.idb / usr / freeware / src / gd / patches.z / patches
Text File  |  2002-04-08  |  11KB  |  307 lines

  1. --- ./Makefile    Thu Feb 22 09:03:43 2001
  2. +++ ../gd-1.8.4/./Makefile    Wed Apr  3 08:46:12 2002
  3. @@ -1,9 +1,28 @@
  4.  #Depending on your system, you will need to modify this makefile.
  5.  
  6. +##sgi  Comments added by the SGI freeware team start with
  7. +##sgi  "##sgi".  This Makefile is based upon GNU make v. 3.79.1.
  8. +
  9.  #If you do not have gcc, change the setting for COMPILER, but you must
  10.  #use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc
  11.  #compiler; get gcc if you are still using it). 
  12. -COMPILER=gcc
  13. +#
  14. +##sgi  $(CC) is overwritten by the SGI freeware build process, so
  15. +##sgi  the setting for COMPILER is ignored; it is equivalent to
  16. +##sgi  the following, for a given choice of ABIISA below (uncomment one).
  17. +##sgi
  18. +##sgi  n.b.: You will need to run "make clean" between builds with
  19. +##sgi        different ABIs.  Failure to do so will result in
  20. +##sgi        errors complaining about incompatible objects.
  21. +##sgi
  22. +##sgi  default case, library in /usr/freeware/lib32
  23. +ABI=n32
  24. +##sgi  old 32-bit ABI, MIPS II instruction set, library in /usr/freeware/lib
  25. +##sgi  ABI=o32
  26. +##sgi  64-bit library, library in /usr/freeware/lib64
  27. +##sgi  ABI=n64
  28. +ABIISA=$(subst o,-mips2 -,$(subst 3 -3,3 -n3,$(subst n,-mips3 -, $(ABI))))
  29. +COMPILER=/usr/bin/cc $(ABIISA)
  30.  
  31.  #If the ar command fails on your system, consult the ar manpage
  32.  #for your system. 
  33. @@ -10,20 +29,19 @@
  34.  AR=ar
  35.  
  36.  #If you don't have FreeType, libjpeg and/or Xpm installed, including the
  37. -#header files, uncomment this (default). You really must install
  38. -#libpng and zlib to get anywhere if you wish to create PNG images.
  39. -CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG
  40. -
  41. +#header files, uncomment this (default).
  42. +#CFLAGS=-O
  43.  #If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a
  44.  #variation of this and comment out the line above. See also LIBS below.
  45. -#CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
  46. -#    -DHAVE_LIBFREETYPE -DHAVE_LIBTTF 
  47. +#CFLAGS=-O  -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
  48. +##sgi
  49. +##sgi  CFLAGS is overwritten by the SGI freeware build process, but
  50. +##sgi  the equivalent information would be
  51. +##WLIST=1009,1014,1048,1107,1110,1116,1164,1185,1188,1204,1230,1233
  52. +##CFLAGS=-O3 -OPT:Olimit=0:space=ON -woff $(WLIST) -Wl,-woff,85,-woff,84\
  53. +##    -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF -DBSD_SIGNALS
  54.  
  55. -#To use the old FreeType 1.x library, add this additional #define
  56. -#to the line above
  57. -#-DHAVE_LIBTTF 
  58. -
  59. -#If you don't have FreeType Xpm fully installed, uncomment this
  60. +#If you don't have FreeType and/or Xpm fully installed, uncomment this
  61.  #(default).
  62.  
  63.  #PLEASE NOTE: YOU MAY HAVE TO JUGGLE THE ORDER OF THE LIBRARIES.
  64. @@ -30,22 +48,43 @@
  65.  #Some systems are very picky about link order. They don't all agree
  66.  #on the right order, either.
  67.  
  68. -LIBS=-lgd -lpng -lz -lm
  69. +#LIBS=-lm -lgd -lpng -lz
  70.  
  71.  #If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a 
  72.  #variation of this and comment out the line above. Note that
  73.  #Xpm requires X11. See also CFLAGS above.
  74.  
  75. -#LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf
  76. -
  77. -#Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead.
  78. +#PLEASE NOTE: YOU MAY HAVE TO JUGGLE THE ORDER OF THE LIBRARIES.
  79. +#Some systems are very picky about link order. They don't all agree
  80. +#on the right order, either.
  81.  
  82. -#Typical install locations for freetype, zlib, xpm, libjpeg and libpng header 
  83. -#files. If yours are somewhere else, change this. -I. is important to 
  84. -#ensure that the version of gd you are installing is used, and not an 
  85. -#older release in your directory tree somewhere.
  86. +#LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
  87.  
  88. -INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include 
  89. +##sgi  LIBS is overwritten by the SGI freeware build process, but
  90. +##sgi  the equivalent information would be
  91. +LIBS=-lgd -lttf -lpng -lz -ljpeg -lXpm -lX11 -lm
  92. +
  93. +##sgi  SHRLIBS is used to make the shared library (.so).  It
  94. +##sgi  uses delayed loads for the Xpm functionality, since many
  95. +##sgi  uses of gd are for the PNG and JPEG functionality only.
  96. +SHRLIBS=$(subst -lgd ,,$(patsubst -lX%,-delay_load -lX%,$(LIBS)))
  97. +
  98. +##sgi  MAINLIB is used to determine whether or not the shared
  99. +##sgi  object library is made.  It is overridden in the SGI
  100. +##sgi  freeware build procedure.  Set it to libgd.so.1.1 if you
  101. +##sgi  wish to make the shared library.
  102. +MAINLIB=libgd.a
  103. +
  104. +#Typical install locations for freetype, zlib, xpm, libjpeg and libpng header files.
  105. +#If yours are somewhere else, change this. 
  106. +#-I. is important to ensure that the version of gd you are installing
  107. +#is used, and not an older release in your directory tree somewhere.
  108. +#INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11
  109. +
  110. +##sgi  INCLUDEDIRS is overwritten by the SGI freeware build process, but
  111. +##sgi  the equivalent information (see the man page for cc regarding
  112. +##sgi  directory search order) would be:
  113. +INCLUDEDIRS=-I/usr/freeware/include -I/usr/include/X11
  114.  
  115.  #Typical install locations for freetype, zlib, xpm and libpng libraries.
  116.  #If yours are somewhere else, other than a standard location
  117. @@ -53,18 +92,25 @@
  118.  #-L. as this allows the gd library itself to be found.
  119.  #Put -L. first so that old versions of the gd library elsewhere
  120.  #on your system can't cause conflicts while building a new one.
  121. -#This line shouldn't hurt if you don't actually have some of the
  122. -#optional libraries and directories.
  123. -LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
  124. -
  125. +#LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
  126. +##sgi
  127. +##sgi  LIBDIRS is overwritten by the SGI freeware build process, but
  128. +##sgi  the equivalent information would be:
  129. +ABIDIR=$(subst o32,lib,$(subst n,lib,$(ABI)))
  130. +LIBDIRS=-L/usr/freeware/$(ABIDIR)
  131. +
  132. +##sgi
  133. +##sgi  The following three "INSTALL" locations aren't actually
  134. +##sgi  used by the SGI freeware build procedure, but the equivalent
  135. +##sgi  values would be
  136.  #Location where libgd.a should be installed by "make install".
  137. -INSTALL_LIB=/usr/local/lib
  138. +INSTALL_LIB=/usr/freeware/$(ABIDIR)
  139.  
  140.  #Location where .h files should be installed by "make install".
  141. -INSTALL_INCLUDE=/usr/local/include
  142. +INSTALL_INCLUDE=/usr/freeware/include
  143.  
  144.  #Location where useful non-test programs should be installed by "make install".
  145. -INSTALL_BIN=/usr/local/bin
  146. +INSTALL_BIN=/usr/freeware/bin
  147.  
  148.  #
  149.  #
  150. @@ -71,7 +117,13 @@
  151.  # Changes should not be required below here.
  152.  #
  153.  #
  154. +##sgi
  155. +##sgi  Some changes are required, because we want to build
  156. +##sgi  shared libraries for the freeware distribution (one
  157. +##sgi  for this is to use them for *other* freeware!).
  158.  
  159. +##sgi  Also, no "ranlib" is required under IRIX.
  160. +RANLIB=:
  161.  VERSION=1.8.4
  162.  
  163.  CC=$(COMPILER) $(INCLUDEDIRS)
  164. @@ -82,7 +134,7 @@
  165.  BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
  166.  TEST_PROGRAMS=gdtest gddemo gd2time gdtestft gdtestttf
  167.  
  168. -all: libgd.a $(PROGRAMS)
  169. +all: $(MAINLIB) $(PROGRAMS)
  170.  
  171.  install: libgd.a $(BIN_PROGRAMS)
  172.      sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
  173. @@ -134,9 +186,9 @@
  174.      $(CC) gd2time.o -o gd2time    $(LIBDIRS) $(LIBS)
  175.  
  176.  gdtestft: gdtestft.o libgd.a
  177. -    $(CC) --verbose gdtestft.o -o gdtestft $(LIBDIRS) $(LIBS)
  178. +    $(CC) gdtestft.o -o gdtestft $(LIBDIRS) $(LIBS)
  179.  gdtestttf: gdtestttf.o libgd.a
  180. -    $(CC) --verbose gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
  181. +    $(CC) gdtestttf.o -o gdtestttf    $(LIBDIRS) $(LIBS)
  182.  
  183.  libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
  184.      gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
  185. @@ -149,8 +201,15 @@
  186.          gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
  187.          gdtables.o gdft.o gdttf.o gdcache.o gdkanji.o wbmp.o \
  188.          gd_wbmp.o gdhelpers.o
  189. -    -ranlib libgd.a
  190. +    -$(RANLIB) libgd.a
  191. +
  192. +libgd.so.1.1: libgd.a
  193. +    $(CC) -elf -shared -no_unresolved -rdata_shared -soname libgd.so \
  194. +        -set_version sgi1.1 -o libgd.so.1.1 -all $< \
  195. +        $(SHRLIBS)
  196. +    ln -s libgd.so.1.1 libgd.so
  197.  
  198.  clean:
  199. -    rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp
  200. +    rm -f *.o libgd.a libgd.so.1.1 libgd.so ${PROGRAMS} \
  201. +        test/gdtest.jpg test/gdtest.wbmp
  202.  
  203. --- ./gd_jpeg.c    Tue Feb 13 12:05:32 2001
  204. +++ ../gd-1.8.4/./gd_jpeg.c    Wed Apr  3 08:46:12 2002
  205. @@ -439,7 +439,7 @@
  206.  
  207.    gdIOCtx *infile;        /* source stream */
  208.    unsigned char * buffer;        /* start of buffer */
  209. -  safeboolean start_of_file;    /* have we gotten any data yet? */
  210. +  safeboolean start_of_file;    /* have we gotten any data yet? */
  211.  } my_source_mgr;
  212.  
  213.  typedef my_source_mgr * my_src_ptr;
  214. @@ -496,31 +496,31 @@
  215.   * Data beyond this point must be rescanned after resumption, so move it to
  216.   * the front of the buffer rather than discarding it.
  217.   */
  218. -
  219. -#define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n"
  220.  
  221. +#define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n"
  222. +
  223.  safeboolean
  224.  fill_input_buffer (j_decompress_ptr cinfo)
  225.  {
  226.    my_src_ptr src = (my_src_ptr) cinfo->src;
  227. -  size_t nbytes = 0;
  228. +  size_t nbytes = 0;
  229.    /* size_t got; */
  230.    /* char *s; */
  231. -  memset(src->buffer, 0, INPUT_BUF_SIZE);
  232. -  while (nbytes < INPUT_BUF_SIZE) {
  233. -      int got = gdGetBuf(src->buffer + nbytes, 
  234. +  memset(src->buffer, 0, INPUT_BUF_SIZE);
  235. +  while (nbytes < INPUT_BUF_SIZE) {
  236. +      int got = gdGetBuf(src->buffer + nbytes, 
  237.            INPUT_BUF_SIZE - nbytes,
  238. -          src->infile);
  239. -      if ((got == EOF) || (got == 0)) {
  240. -          /* EOF or error. If we got any data, don't worry about it.
  241. -            If we didn't, then this is unexpected. */
  242. -          if (!nbytes) {
  243. -            nbytes = -1;
  244. -          }
  245. -          break;
  246. -      }
  247. -      nbytes += got;
  248. -  }
  249. +          src->infile);
  250. +      if ((got == EOF) || (got == 0)) {
  251. +          /* EOF or error. If we got any data, don't worry about it.
  252. +            If we didn't, then this is unexpected. */
  253. +          if (!nbytes) {
  254. +            nbytes = -1;
  255. +          }
  256. +          break;
  257. +      }
  258. +      nbytes += got;
  259. +  }
  260.    if (nbytes <= 0) {
  261.      if (src->start_of_file)    /* Treat empty input file as fatal error */
  262.        ERREXIT(cinfo, JERR_INPUT_EMPTY);
  263. @@ -593,10 +593,10 @@
  264.  
  265.  void
  266.  term_source (j_decompress_ptr cinfo)
  267. -{
  268. +{
  269.  #if 0
  270.  /* never used */
  271. -    my_src_ptr src = (my_src_ptr) cinfo->src;
  272. +    my_src_ptr src = (my_src_ptr) cinfo->src;
  273.  #endif
  274.  }
  275.  
  276. @@ -627,7 +627,7 @@
  277.      src = (my_src_ptr) cinfo->src;
  278.      src->buffer = (unsigned char *)
  279.        (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
  280. -                  INPUT_BUF_SIZE * sizeof(unsigned char));
  281. +                  INPUT_BUF_SIZE * sizeof(unsigned char));
  282.    }
  283.  
  284.    src = (my_src_ptr) cinfo->src;
  285. --- ./gdtestft.c    Tue Feb  6 11:44:02 2001
  286. +++ ../gd-1.8.4/./gdtestft.c    Wed Apr  3 08:46:12 2002
  287. @@ -51,7 +51,7 @@
  288.      char *f = "/usr/openwin/lib/locale/ja/X11/fonts/TT/HG-MinchoL.ttf"; /* UNICODE */
  289.      /* char *f = "/usr/local/lib/fonts/truetype/DynaFont/dfpop1.ttf"; */ /* SJIS */
  290.  #else
  291. -    char *f = "times"; /* TrueType font */
  292. +    char *f = "/usr/tmp/times.ttf"; /* TrueType font */
  293.  #endif
  294.      
  295.      /* obtain brect so that we can size the image */
  296. --- ./gdtestttf.c    Tue Feb  6 11:44:02 2001
  297. +++ ../gd-1.8.4/./gdtestttf.c    Wed Apr  3 08:46:12 2002
  298. @@ -44,7 +44,7 @@
  299.      char *f = "/usr/openwin/lib/locale/ja/X11/fonts/TT/HG-MinchoL.ttf"; /* UNICODE */
  300.      /* char *f = "/usr/local/lib/fonts/truetype/DynaFont/dfpop1.ttf"; */ /* SJIS */
  301.  #else
  302. -    char *f = "/usr/local/lib/fonts/truetype/misc/times.ttf"; /* TrueType font */
  303. +    char *f = "/usr/tmp/times.ttf"; /* TrueType font */
  304.  #endif
  305.      
  306.      fprintf(stderr, "HEY! THIS IS FOR THE FREETYPE 1.x LIBRARY.\n\n");
  307.